<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html> 
<html class="zh-cn zh cn" lang="zh-cn"> 
<head>
	<%@ include file="../head.jsp" %>
</head>

<body class="vday home"> 
	<div id="page">
	<%@ include file="../global_navi.jsp" %>
	<%@ include file="../aos_header.jsp" %><!-- 如果需要查询，要自定义aos_header -->
 	<%@ include file="../guide.jsp" %><!-- 动态向导栏，需要后台 -->

	<div id="primary"> 
		<div id="primary_main" role="main">
			<div class="box product-shelf">
        		<div class="box-content clearfix">
					<ul id="family-ipad" class="first-row">
						<li class="product first" id="family-prod-ipad">
							<a href="javascript: void(0)" onclick="" >
								<span>
								<img type="local" alt="items" src="/resource/style/xpdd/act/image/i_blank.jpg" id="img_${actBean.aid}" />
								</span>
							</a>
						</li>
					</ul>

					<ul id="family-ipod" class="first-row">
						<li class="product" id="family-prod-shuffle">
							<br />
							<span><strong>宝贝名称:</strong>&nbsp;&nbsp;<nobr><c:out value="${actBean.aname }"></c:out></nobr></span>
							<br />
							<span><strong>创建人:</strong>&nbsp;&nbsp;&nbsp;&nbsp;<nobr><c:out value="${actBean.nick }"></c:out></nobr></span>
							<br />
							<span><strong>模版类型:</strong>&nbsp;&nbsp;<nobr><c:out value="${actSettingBean.name }"></c:out></nobr></span>
							<br />
							<span><strong>活动时间:</strong>&nbsp;&nbsp;<nobr>
								<fmt:formatDate value="${actBean.beginTime }" pattern="yyyy-MM-dd HH:mm:ss"/> ~ 
								<fmt:formatDate value="${actBean.endTime }" pattern="yyyy-MM-dd HH:mm:ss"/></nobr>
							</span>
							<br />
							<span><strong>宝贝数量:</strong>&nbsp;&nbsp;<nobr><c:out value="${actBean.xpddItemSize }"></c:out>件</nobr></span>
							<br />
							<span><strong>创建日期:</strong>&nbsp;&nbsp;<nobr>
								<fmt:formatDate value="${actBean.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
							</nobr></span>
							<br />
							<span><strong>参与人次:</strong>&nbsp;&nbsp;<nobr>
								<c:out value="${actBean.userSize }"></c:out>人次</nobr>
								<!--<c:out value="${actBean.dealNum }"></c:out>人次成交-->
							</span>
						</li>
					</ul>
					<!-- 距离活动开始还有15天.-->
					<p id="free-shipping"><strong><c:out value="${activityDesc }"></c:out></strong>.</p>
				</div>

				<div class="top-corners"></div>
				<div class="bottom-corners"></div>
			</div>
			<ul class="home-page-banners clearfix"></ul>
			
			<div class="module footerblock">
			<!-- 
				<h2><span>详细信息</span></h2>
				<div class="modulecontent">
					<div id="store_details">
						<div class="column first">
							<div class="modulecontentwrap last-row superlink">
								<br />
								<strong>参数信息</strong>
								<br/>
								<strong>活动隐私</strong>:&nbsp;&nbsp;<nobr>
									<c:choose>
										<c:when test="${actBean.activityScope == 0 }">所有人均可参加</c:when>
										<c:when test="${actBean.activityScope == 1 }">淘宝用户均可参加</c:when>	
										<c:when test="${actBean.activityScope == 2 }">购买过本店商品的用户</c:when>
										<c:otherwise>淘宝用户均可参加</c:otherwise>								
									</c:choose>
								</nobr>
								<br/>
								<strong>未购买者使用偷听</strong>:&nbsp;&nbsp;
								<nobr>
									<c:choose>
										<c:when test="${actBean['eave']}">允许</c:when>
										<c:otherwise>不允许</c:otherwise>
									</c:choose>
								</nobr>
								<br/>
								<strong>显示收藏按钮</strong>:&nbsp;&nbsp;
								<nobr>
									<c:choose>
										<c:when test="${actBean['favorsite']}">显示</c:when>
										<c:otherwise>隐藏</c:otherwise>
									</c:choose>
								</nobr>
								<br/>
								<strong>显示分享按钮</strong>:&nbsp;&nbsp;
								<nobr>
									<c:choose>
										<c:when test="${actBean['share']}">显示</c:when>
										<c:otherwise>隐藏</c:otherwise>
									</c:choose>
								</nobr>
								<br/>
								<strong>是否开启帮助</strong>:&nbsp;&nbsp;
								<nobr>
									<c:choose>
										<c:when test="${actBean['help']}">开启</c:when>
										<c:otherwise>关闭</c:otherwise>
									</c:choose>
								</nobr>
								<br/>
							</div>
						</div>
					</div>
					<div id="store_updates">
						<div class="modulecontentwrap">
							<h3 align="center">自定义公告信息</h3>
							<div align="center"><p>${actBean.notice }</p></div>
						</div>
					</div>
				</div>
			-->
				<div class="module_btm">&nbsp;</div>
			</div>

			<div class="box featured-accessories">
				<div class="title-bar">
					<h2>最新成交记录</h2>
				</div>
				<div class="box-content clearfix">
					<div class="product-grid"> 
						<c:forEach items="${actRecordList }" var="record" varStatus="status">
							<c:if test="${status.index % 4 == 0 }">
								<ul class="product-row clearfix first-row">
							</c:if>
							<li class="superlink product first-tile">
								<dl>
									<dt class="name" title="nick_22"><c:out value="${record.buyerNick}"></c:out></dt>
									<dd class="price">
										${record.status }
                                        <span class="current_price">
                                            <c:if test="${record.status == 1}">成交</c:if>
                                            <c:if test="${record.status == 0}">未同步</c:if>
                                            <c:if test="${record.status == 2}">未同步</c:if>
                                        </span>
                                    </dd>
                                    <dd class="price">
                                        <span class="current_price">
                                            <fmt:formatNumber value="${record.price}" type="currency" var="money"/>
                                            <c:out value="${money }"></c:out>
                                        </span>
                                    </dd>
									<dd class="price"><span class="current_price"><fmt:formatDate value="${record.recordTime }" pattern="yyyy-MM-dd HH:mm:ss"/></span></dd>
								</dl>
							</li>
							<c:if test="${status.index % 4 == 3}">
								</ul>
							</c:if>
						</c:forEach>
					</div>
				</div>
				<div class="bottom-corners"></div>
			</div>
		</div>
		<c:set var="localNick" value="${sessionScope.seller.nick }"></c:set>
		<div id="secondary" class="rail">
			<div role="navigation" aria-label="New Items" class="box navigation-list new-to-store">
				<div class="title-bar">
					<h2>操作</h2>
				</div>
				<div class="box-content clearfix">
					<div class="list_content">
						<ul>
							<c:if test="${actBean.nick == localNick }">
								<li><a href="/activity/edit_${actBean.aid}" onclick="singleLoading();" >编辑活动</a></li>
								<li><a href="/activity/del_${actBean.aid}" onclick="singleLoading();" >删除活动</a></li>
								<li><a href="/analysis/activity_${actBean.aid}" onclick="singleLoading();" >数据分析</a></li>
							</c:if>
							<li><a href="/activity/record_${actBean.aid}" onclick="singleLoading();" >活动记录</a></li>
						</ul>
					</div>
				</div>
				<div class="bottom-corners"></div>
			</div>

			<div class="box navigation-list top-sellers">
				<div class="title-bar">
					<h2>更多活动</h2>
				</div>
				<div class="box-content clearfix">
					<div class="list_content" id="moreActUL">
						<ul class="ordered" >
							<li><a href="#" onclick="" >&nbsp;&nbsp;&nbsp;&nbsp;血拼活动B</a></li>
	               			<li><span>2011-5-11 0参与/0成交</span></li>
	               			<li><a href="#" onclick="" >&nbsp;&nbsp;&nbsp;&nbsp;血拼活动C</a></li>
	               			<li><span>2011-6-1 0参与/0成交</span></li>
	               			<li><a href="#" onclick="" >&nbsp;&nbsp;&nbsp;&nbsp;血拼活动D</a></li>
	               			<li><span>已开始 10参与/2成交</span></li>
	               			<li>&nbsp;&nbsp;&nbsp;&nbsp;<em><a href="/activity/list">更多...</a></em></li>
	       				</ul>
	    			</div>
				</div>
				<div class="bottom-corners"></div>
			</div>
			<div class="module footerblock"></div>
		</div>
	</div>
		
	<%@ include file="../left_navi.jsp" %>
	<%@ include file="../footer.jsp" %>
	</div>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
	//设置当前路径
	jQuery("#breadcrumb").append('<li><span>:&nbsp;&nbsp;宝贝信息察看</span></li>');
	//ajax查询更多活动模块
	getMoreActs();
	//设置宝贝图片
    getAllURL();
});
function getAllURL()
{
    var ids = new Array();
    //获取所有宝贝的id
    jQuery("img[type]").each(function(i){
        var tid = this.id.split("_")[1];
        ids.push(tid);
    });
    //如果没有宝贝,不查询
    if (ids.length <= 0)
    {
        return false;
    }

    jQuery.ajax({
        url : '/activity/getURL',
        contentType : 'application/json',
        type : "GET",
        dataType : 'json',
        data : {
            "ids" : ids.toString()
        },
        beforeSend : function (XMLHttpRequest) {
            //this;// 调用本次AJAX请求时传递的options参数
        },
        complete : function (XMLHttpRequest, textStatus) {
            //this; // 调用本次AJAX请求时传递的options参数
        },
        error : function (XMLHttpRequest, textStatus, errorThrown) {
            // 通常 textStatus 和 errorThrown 之中
            // 只有一个会包含信息
            //this; // 调用本次AJAX请求时传递的options参数
            return false;
        },
        success : function (data, textStatus) {
            // data 可能是 xmlDoc, jsonObj, html, text, 等等...
            var tmpData = data;//eval( "(" + data + ")");
            jQuery("img[type]").each(function(i){
                var tid = this.id.split("_")[1];
                if (tmpData[tid] != "")
                {
                    this.src = tmpData[tid];
                }
                //jQuery(this.id).load(tmpData[tid]);
            });
            //this; // 调用本次AJAX请求时传递的options参数
        }
    });
}
function getMoreActs()
{
    var id = ${actBean.aid};
    jQuery.ajax({
        url : '/activity/getActivityByIdMore',
        type : "GET",
        dataType : 'html',
        data : {
            "id" : id
        },
        beforeSend : function (XMLHttpRequest) {
            //this;// 调用本次AJAX请求时传递的options参数
        },
        complete : function (XMLHttpRequest, textStatus) {
            //this; // 调用本次AJAX请求时传递的options参数
        },
        error : function (XMLHttpRequest, textStatus, errorThrown) {
            // 通常 textStatus 和 errorThrown 之中
            // 只有一个会包含信息
            //this; // 调用本次AJAX请求时传递的options参数
            return false;
        },
        success : function (data, textStatus) {
            jQuery("#moreActUL").html(data);
        }
    });
}
function singleLoading(){
    jQuery("#nyroDiv a").nmCall();
}
//]]>
</script>
</body>
</html>
 